package com.example.webgobang.controller;

import com.example.webgobang.model.domin.ChessHistory;
import com.example.webgobang.service.ChessHistoryService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/chess")
public class ChessHistoryController {
    @Resource
    private ChessHistoryService chessHistoryService;

    @GetMapping("/history")
    public ChessHistory getHistory(String roomId) {
        return chessHistoryService.selectHistory(roomId);
    }
}
